<?php


namespace App\HttpController\Pet;


use App\HttpController\Base\AuthBase;
use App\Service\LoginService;

class User extends AuthBase
{
    public function bindUserPhone()
    {
        //'uid-' . $user_id . '-session_key'
        $raw_data = $this->getRawData();

        if (!isset($raw_data['encryptedData']) || !isset($raw_data['iv'])) {
            return $this->error('绑定手机号码失败');
        }

        $result = LoginService::getWeappMobile($this->system_app_id, $this->user_id, $raw_data);
        if (isset($result['phoneNumber'])) {
            if ($result['countryCode'] != '86') {
                return $this->error('暂不支持非中国大陆地区手机号码绑定');
            }
            // 
        }
        //


    }

}